package com.bangyu.monitor.modular.system.controller;

import cn.stylefeng.roses.core.base.controller.BaseController;
import com.bangyu.monitor.core.common.page.LayuiPageFactory;
import com.bangyu.monitor.modular.system.biz.RiskBiz;
import com.bangyu.monitor.modular.system.entity.Risk;
import com.bangyu.monitor.modular.system.warpper.RiskWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zhangxue
 * @Date: 19/5/3 09:29
 * @Description:
 */
@Controller
@RequestMapping("/risk")
public class RiskController extends BaseController {

    @Autowired
    private RiskBiz riskBiz;

    @RequestMapping("/page")
    @ResponseBody
    public Object pageQueryByRole(@RequestParam(value = "condition",required = false) String condition,
            @RequestParam(value = "riskLevel",required = false) Integer riskLevel,
            @RequestParam(value = "riskType",required = false) Integer riskType){
        Page<Risk> page = riskBiz.pageByPermission(condition,riskLevel,riskType);

        return LayuiPageFactory.createPageInfo(new RiskWrapper(page).wrap());
    }
}
